package com.ushine.design.design.c_behavioral_pattern.e_mediator.c_extend;


import com.ushine.design.design.c_behavioral_pattern.e_mediator.b_example.Component;
import com.ushine.design.design.c_behavioral_pattern.e_mediator.b_example.ConcreteMediator;

public class SubConcreteMediator extends ConcreteMediator {
    //增加标签对象Label引用
    public Label label;

    @Override
    public void componentChanged(Component c) {

        if (c == addButton) {
            System.out.println(" -- 单击增加按钮 -- ");
            list.update();
            bo.update();
            userNameTextBox.update();
            label.update();
        } else if (c == list) {
            System.out.println(" -- 从列表框选择客户 -- ");
            bo.select();
            ;
            userNameTextBox.setText();
        } else if (c == bo) {
            System.out.println(" -- 从组合框选择客户 -- ");
            bo.select();
            userNameTextBox.setText();
        }

    }
}
